import type {User , UserInfo,LikeMinded, codeType , LikeMindedList} from "@/types/user"
import {request} from "@/utils/request"

// 用密码执行登陆

export const  loginByPassword = (mobile:string,password:string)=>
  request<User>('/login/password','POST',{mobile,password})


export const sendMobileCode = (mobile:string,type:codeType) => 
  request('/code','GET',{mobile,type})



export const getUserInfo = ()=> {
  return request<UserInfo>('/inthepink/myUser','GET')
}


export const getLikeMindedList = ()=> {
  return request<LikeMindedList>('/inthepink/mylist','GET')
}

export const addLikeMinded = (LikeMinded: LikeMinded) => request('/inthepink/add', 'POST', LikeMinded)

export const editLikeMinded = (LikeMinded: LikeMinded) => request('/inthepink/update', 'PUT', LikeMinded)
export const delLikeMinded = (id: string) => request(`/inthepink/del/${id}`, 'DELETE')